using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class WorklistMap : EntityTypeConfiguration<Worklist>
	{
		public WorklistMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Id)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.NameValue)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("Worklists");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.NameValue).HasColumnName("NameValue");
			this.Property(t => t.OwnerId).HasColumnName("OwnerId");
			this.Property(t => t.GroupId).HasColumnName("GroupId");
			this.Property(t => t.HospitalUnitLobId).HasColumnName("HospitalUnitLobId");
			this.Property(t => t.RoomId).HasColumnName("RoomId");
			this.Property(t => t.RegistrationId).HasColumnName("RegistrationId");
			this.Property(t => t.HospitalUnitId).HasColumnName("HospitalUnitId");
			this.Property(t => t.LineOffBusinessUnitID).HasColumnName("LineOffBusinessUnitID");
		}
	}
}

